import type * as T from './type'
import http from '@/utils/http'
import type {CourseDto} from "./type";
export type { CourseDto,CourseQuery} from './type'
const BASE_URL = '/system/course'
/** @desc 查询課程列表 */
export function listCourse(query: T.CourseQuery) {
  return http.get<PageRes<T.CoursePageQuery[]>>(`${BASE_URL}/page`, query)
}
export function recyclePages(query: T.CourseQuery) {
  return http.get<PageRes<T.CoursePageQuery[]>>(`${BASE_URL}/recyclePage`, query)
}

/** @desc 根據單元編號查询課程集合 */
export function getByUnitIdCourses(query: any) {
  return http.get<CourseDto[]>(`${BASE_URL}/list`,query)
}


/** @desc 查询課程详情 */
export function getCourse(id: string) {
  return http.get<T.CourseDto>(`${BASE_URL}/getData/${id}`)
}

/** @desc 新增課程 */
export function addCourse(data: any) {
  return http.post(`${BASE_URL}/create`, data)
}

/** @desc 修改課程 */
export function updateCourse(data: any) {
  return http.post(`${BASE_URL}/modify`, data)
}

/** @desc 逻辑删除課程 */
export function logicDeleteCourse(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/logicDeleteCourse/${ids}`)
}

/** @desc 删除課程 */
export function deleteCourse(ids: string | Array<string>) {
  return http.del(`${BASE_URL}/delete/${ids}`)
}


